Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OP Scan block explorer to Optimism Docs #1129

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

saimeunt
Copy link

Description

This PR is adding a section about OP Scan, a tailor-made Open Source Block Explorer for the OP Stack.
The added section is explaining how to run locally the explorer against either your local devnet or any other OP Stack based chain.
While the primary focus of OP Scan is providing a lightweight explorer you can run locally on a a laptop, we might consider adding more resources on how to host the explorer in production later on.

Additional context

OP Scan is under active development and is looking forward to add key features to complete its goal as being a lightweight explorer aligned with the Superchan vision.
Here's a video walkthrough on how to launch the explorer locally configured for OP Sepolia testnet.
You can test a live version of OP Scan deployed against OP Sepolia at opscan.co.

@krofax Sorry about the false start, opscan.co should be up and running without any hiccup now.

@saimeunt saimeunt requested a review from a team as a code owner November 19, 2024 18:28
Copy link

netlify bot commented Nov 19, 2024

Deploy Preview for docs-optimism ready!

Name Link
🔨 Latest commit 427875f
🔍 Latest deploy log https://app.netlify.com/sites/docs-optimism/deploys/67497908626b3e0008b11a50
😎 Deploy Preview https://deploy-preview-1129--docs-optimism.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

coderabbitai bot commented Nov 19, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces a new tool called "OP Scan Block Explorer" by adding an entry to the JSON object in pages/builders/chain-operators/tools/_meta.json. The new entry is "op-scan": "OP Scan Block Explorer", which expands the existing list of chain operators without modifying or removing any other entries. Additionally, a new documentation file named op-scan.mdx is created, detailing the functionality and setup of the OP Scan tool. This documentation explains how to run the OP Scan locally alongside an OP Stack devnet or compatible rollup, including installation instructions, dependency requirements, and configuration for both L1 and L2 chains. It also provides guidance on managing the indexing process, addressing potential issues such as rate-limiting, and concludes with instructions for building and running the explorer.

Possibly related PRs

  • Create chain-monitoring.mdx #764: This PR adds a new key-value pair "chain-monitoring": "Chain Monitoring" to the same _meta.json file, indicating a related modification to the metadata structure.
  • op-deployer + opcm documentation #934: This PR also modifies the _meta.json file by adding a new entry for "op-deployer": "Deployer", showing a direct connection in terms of changes made to the same file.

Suggested labels

documentation, tutorial

Suggested reviewers

  • cpengilly
  • krofax

📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between e8fe804 and 427875f.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/tools/op-scan.mdx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pages/builders/chain-operators/tools/op-scan.mdx

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (5)
pages/builders/chain-operators/tools/op-scan.mdx (5)

1-5: Apply sentence case to title and description

According to the coding guidelines, headers should use sentence case. Update the frontmatter:

---
-title: op-scan
+title: OP Scan
lang: en-US
-description: Learn how to launch OP Scan, a block explorer designed for your OP Stack chain.
+description: Learn how to launch OP Scan, a block explorer designed for your OP Stack chain
---

30-33: Use correct terminology and consider version requirements

  • Use "Node.js" instead of "NodeJS"
  • Consider using more flexible version requirements to avoid unnecessary restrictions
NodeJS >= 22
pnpm >= 9
+
+Note: Node.js 20 LTS should also be compatible.

49-75: Improve writing style and grammar

The text contains repetitive phrasing and missing punctuation:

-You will need to copy `.env.local.example` into `.env.local` at the root of your repository and populate it with your own values.
-In particular you will need to provide configuration for both L1 and L2 chains:
+Copy `.env.local.example` into `.env.local` at the root of your repository and populate it with your own values.
+In particular, configure both L1 and L2 chains:

-You will also need to provide your L1 contracts addresses when using a devnet:
+For devnet usage, specify the L1 contract addresses:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~51-~51: A comma is probably missing here.
Context: ...d populate it with your own values. In particular you will need to provide configuration ...

(MISSING_COMMA_AFTER_INTRODUCTORY_PHRASE)


[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...s://www.quicknode.com/). You will also need to provide your L1 contracts addresses whe...

(REP_NEED_TO_VB)


[style] ~72-~72: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: .../L1Contract.json`. Note that you always need to provide the proxy address, not the unde...

(REP_NEED_TO_VB)


84-90: Fix grammar in database configuration

Address grammar issues and improve clarity:

-To run the indexer, you first need to setup your `DATABASE_URL` in `.env.local` (we use SQLite by default but you can switch to PostgreSQL by changing the Prisma provider in `prisma/schema.prisma`) as well as websocket connections to your L1/L2 chains:
+To run the indexer, first set up your `DATABASE_URL` in `.env.local` (we use SQLite by default, but you can switch to PostgreSQL by changing the Prisma provider in `prisma/schema.prisma`) and configure websocket connections to your L1/L2 chains:
🧰 Tools
🪛 LanguageTool

[grammar] ~84-~84: The word “setup” is a noun. The verb is spelled with a space.
Context: ... To run the indexer, you first need to setup your DATABASE_URL in .env.local (we...

(NOUN_VERB_CONFUSION)


[uncategorized] ~84-~84: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...n .env.local (we use SQLite by default but you can switch to PostgreSQL by changin...

(COMMA_COMPOUND_SENTENCE)


161-165: Add missing comma after introductory word

Fix grammar:

-Alternatively you can launch the explorer in dev mode if you want to customize it:
+Alternatively, you can launch the explorer in dev mode if you want to customize it:
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between fb39b54 and 7a57724.

📒 Files selected for processing (2)
  • pages/builders/chain-operators/tools/_meta.json (1 hunks)
  • pages/builders/chain-operators/tools/op-scan.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • pages/builders/chain-operators/tools/_meta.json
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/chain-operators/tools/op-scan.mdx (1)

Pattern **/*.mdx: "ALWAYS review Markdown content THOROUGHLY with the following criteria:

  • Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
  • Avoid gender-specific language and use the imperative form.
  • Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
  • Ensure proper nouns are capitalized in sentences.
  • Apply the Oxford comma.
  • Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
  • Use correct spelling and grammar at all times (IMPORTANT).
  • For H1, H2, and H3 headers:
    1. Use sentence case, capitalizing only the first word.
    2. Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
    3. Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
  • Flag any headers that seem to inconsistently apply these rules for manual review.
  • When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
    "
🪛 LanguageTool
pages/builders/chain-operators/tools/op-scan.mdx

[uncategorized] ~51-~51: A comma is probably missing here.
Context: ...d populate it with your own values. In particular you will need to provide configuration ...

(MISSING_COMMA_AFTER_INTRODUCTORY_PHRASE)


[style] ~64-~64: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...s://www.quicknode.com/). You will also need to provide your L1 contracts addresses whe...

(REP_NEED_TO_VB)


[style] ~72-~72: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: .../L1Contract.json`. Note that you always need to provide the proxy address, not the unde...

(REP_NEED_TO_VB)


[style] ~76-~76: You have already used this phrasing in nearby sentences. Consider replacing it to add variety to your writing.
Context: ...re on verified contracts, you will also need to provide a [Reown](https://docs.reown.co...

(REP_NEED_TO_VB)


[grammar] ~84-~84: The word “setup” is a noun. The verb is spelled with a space.
Context: ... To run the indexer, you first need to setup your DATABASE_URL in .env.local (we...

(NOUN_VERB_CONFUSION)


[uncategorized] ~84-~84: Use a comma before ‘but’ if it connects two independent clauses (unless they are closely connected and short).
Context: ...n .env.local (we use SQLite by default but you can switch to PostgreSQL by changin...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~104-~104: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... blocks getting indexed in your terminal and you can explore the state of your local...

(COMMA_COMPOUND_SENTENCE)


[style] ~117-~117: Specify a number, remove phrase, or simply use “many” or “numerous”
Context: ... load on the RPC as you need to perform a large number of JSON-RPC requests to fully index a bloc...

(LARGE_NUMBER_OF)


[uncategorized] ~155-~155: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...` Make sure your local chain is started and the indexer is running, then launch the...

(COMMA_COMPOUND_SENTENCE_2)


[typographical] ~160-~160: Consider adding a comma after ‘Alternatively’ for more clarity.
Context: .../localhost:3000` sh pnpm start Alternatively you can launch the explorer in dev mode...

(RB_LY_COMMA)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (8)
pages/builders/chain-operators/tools/op-scan.mdx (8)

9-9: Adjust header formatting for consistency

According to the coding guidelines, H1 headers should use sentence case. Consider changing to:

-# 🔎 OP Scan
+# 🔎 Op scan

66-68: Add placeholder indicators for contract addresses

Make it clearer that these values need to be replaced by adding placeholder indicators:

-NEXT_PUBLIC_OPTIMISM_PORTAL_ADDRESS="..."
-NEXT_PUBLIC_L1_CROSS_DOMAIN_MESSENGER_ADDRESS="..."
+NEXT_PUBLIC_OPTIMISM_PORTAL_ADDRESS="<your-optimism-portal-address>"
+NEXT_PUBLIC_L1_CROSS_DOMAIN_MESSENGER_ADDRESS="<your-l1-cross-domain-messenger-address>"

75-79: Add instructions for obtaining Reown project ID

Consider adding instructions or a link explaining how to obtain a Reown project ID for the Write Contract feature.


103-103: Add comma for better readability

Add a comma before "and" to improve readability:

-You should start seeing blocks getting indexed in your terminal and you can explore the state of your local database using Prisma studio:
+You should start seeing blocks getting indexed in your terminal, and you can explore the state of your local database using Prisma studio:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~103-~103: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... blocks getting indexed in your terminal and you can explore the state of your local...

(COMMA_COMPOUND_SENTENCE)


116-117: Improve clarity of indexing load description

Revise the sentence for better clarity:

-Indexing a blockchain is putting a heavy load on the RPC as you need to perform a large number of JSON-RPC requests to fully index a block (along with transactions and logs).
+Indexing a blockchain puts a heavy load on the RPC because it requires numerous JSON-RPC requests to fully index each block (along with transactions and logs).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~116-~116: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...isma:db:push ``` Indexing a blockchain is putting a heavy load on the RPC as you need to ...

(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)


[style] ~116-~116: Specify a number, remove phrase, or simply use “many” or “numerous”
Context: ... load on the RPC as you need to perform a large number of JSON-RPC requests to fully index a bloc...

(LARGE_NUMBER_OF)


143-143: Add context to example block numbers

Consider adding comments to explain what these block numbers represent or use more meaningful example values.


154-154: Add comma for better readability

Add a comma before "and" to improve readability:

-Make sure your local chain is started and the indexer is running, then launch the explorer to see it live at `http://localhost:3000`
+Make sure your local chain is started, and the indexer is running, then launch the explorer to see it live at `http://localhost:3000`
🧰 Tools
🪛 LanguageTool

[uncategorized] ~154-~154: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...` Make sure your local chain is started and the indexer is running, then launch the...

(COMMA_COMPOUND_SENTENCE_2)


160-164: Add development mode benefits

Consider explaining the benefits of using development mode, such as hot reloading or debugging capabilities.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 7a57724 and 913e368.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/tools/op-scan.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/chain-operators/tools/op-scan.mdx (1)

Pattern **/*.mdx: "ALWAYS review Markdown content THOROUGHLY with the following criteria:

  • Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
  • Avoid gender-specific language and use the imperative form.
  • Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
  • Ensure proper nouns are capitalized in sentences.
  • Apply the Oxford comma.
  • Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
  • Use correct spelling and grammar at all times (IMPORTANT).
  • For H1, H2, and H3 headers:
    1. Use sentence case, capitalizing only the first word.
    2. Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
    3. Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
  • Flag any headers that seem to inconsistently apply these rules for manual review.
  • When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
    "
🪛 LanguageTool
pages/builders/chain-operators/tools/op-scan.mdx

[uncategorized] ~103-~103: Use a comma before ‘and’ if it connects two independent clauses (unless they are closely connected and short).
Context: ... blocks getting indexed in your terminal and you can explore the state of your local...

(COMMA_COMPOUND_SENTENCE)


[uncategorized] ~116-~116: This verb may not be in the correct tense. Consider changing the tense to fit the context better.
Context: ...isma:db:push ``` Indexing a blockchain is putting a heavy load on the RPC as you need to ...

(AI_EN_LECTOR_REPLACEMENT_VERB_TENSE)


[style] ~116-~116: Specify a number, remove phrase, or simply use “many” or “numerous”
Context: ... load on the RPC as you need to perform a large number of JSON-RPC requests to fully index a bloc...

(LARGE_NUMBER_OF)


[uncategorized] ~154-~154: Use a comma before “and” if it connects two independent clauses (unless they are closely connected and short).
Context: ...` Make sure your local chain is started and the indexer is running, then launch the...

(COMMA_COMPOUND_SENTENCE_2)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Outside diff range and nitpick comments (5)
pages/builders/chain-operators/tools/op-scan.mdx (5)

9-9: Adjust header formatting

The H1 header contains an emoji followed by "OP Scan". According to the coding guidelines, headers should use sentence case while preserving the capitalization of proper nouns. The current format is acceptable, but consider moving the emoji to a separate line or removing it for consistency with documentation standards.


40-40: Consider using HTTPS URL for git clone

The git clone command uses SSH format which might not work for users without SSH keys configured. Consider providing the HTTPS URL alternative:

-git clone [email protected]:walnuthq/op-scan
+git clone https://github.com/walnuthq/op-scan.git

116-116: Add comma for better readability

Add a comma after "RPC" to improve sentence structure:

-Indexing a blockchain puts a heavy load on the RPC as you need to perform many JSON-RPC requests to fully index a block (along with transactions and logs).
+Indexing a blockchain puts a heavy load on the RPC, as you need to perform many JSON-RPC requests to fully index a block (along with transactions and logs).
🧰 Tools
🪛 LanguageTool

[uncategorized] ~116-~116: Possible missing comma found.
Context: ...g a blockchain puts a heavy load on the RPC as you need to perform many JSON-RPC re...

(AI_HYDRA_LEO_MISSING_COMMA)


148-148: Add comma for better readability

Add a comma after "variables" to improve sentence structure:

-When you're done configuring your environment variables you can build the app:
+When you're done configuring your environment variables, you can build the app:
🧰 Tools
🪛 LanguageTool

[uncategorized] ~148-~148: Possible missing comma found.
Context: ...ou're done configuring your environment variables you can build the app: ```sh pnpm buil...

(AI_HYDRA_LEO_MISSING_COMMA)


154-158: Add port number information

While the port number (3000) is mentioned in the text, consider adding it to the command section for better visibility. Also, consider mentioning if this port can be configured through environment variables.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 913e368 and e8fe804.

📒 Files selected for processing (1)
  • pages/builders/chain-operators/tools/op-scan.mdx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
pages/builders/chain-operators/tools/op-scan.mdx (1)

Pattern **/*.mdx: "ALWAYS review Markdown content THOROUGHLY with the following criteria:

  • Use proper nouns in place of personal pronouns like 'We' and 'Our' to maintain consistency in communal documentation.
  • Avoid gender-specific language and use the imperative form.
  • Monitor capitalization for emphasis. Avoid using all caps, italics, or bold for emphasis.
  • Ensure proper nouns are capitalized in sentences.
  • Apply the Oxford comma.
  • Use proper title case for buttons, tab names, page names, and links. Sentence case should be used for body content and short phrases, even in links.
  • Use correct spelling and grammar at all times (IMPORTANT).
  • For H1, H2, and H3 headers:
    1. Use sentence case, capitalizing only the first word.
    2. Preserve the capitalization of proper nouns, technical terms, and acronyms as defined in the 'nouns.txt' file located in the root directory of the project.
    3. Do not automatically lowercase words that appear in the 'nouns.txt' file, regardless of their position in the header.
  • Flag any headers that seem to inconsistently apply these rules for manual review.
  • When reviewing capitalization, always refer to the 'nouns.txt' file for the correct capitalization of proper nouns and technical terms specific to the project.
    "
🪛 LanguageTool
pages/builders/chain-operators/tools/op-scan.mdx

[uncategorized] ~116-~116: Possible missing comma found.
Context: ...g a blockchain puts a heavy load on the RPC as you need to perform many JSON-RPC re...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~148-~148: Possible missing comma found.
Context: ...ou're done configuring your environment variables you can build the app: ```sh pnpm buil...

(AI_HYDRA_LEO_MISSING_COMMA)

@mazurroman
Copy link

Can we kindly get a review on this PR?

For context: this PR is part of our Season 5 grant (link) for building a local-first, lightweight and open-source block explorer for the Superchain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants